package dom.xpath.data;

import dom.xpath.core.Prop;
import dom.xpath.util.Token;

/**
 * This class assembles texts which are used in the data classes.
 *
 * @author Workgroup DBIS, University of Konstanz 2005-07, ISC License
 * @author Christian Gruen
 */
public interface DataText {
  // META DATA ================================================================

  /** Database version; if it's modified, old database instances can't
   * be parsed anymore. */
  String STORAGE = "6";

  /** Database Update. */
  String DBUPDATE = "Please create a new database.";

  /** Database version. */
  String DBSTORAGE = "STORAGE";
  /** Last modification time. */
  String DBTIME = "TIME";
  /** Tree height. */
  String DBHEIGHT = "HEIGHT";
  /** Number of XML nodes. */
  String DBSIZE = "SIZE";
  /** File name. */
  String DBFNAME = "FNAME";
  /** File size. */
  String DBFSIZE = "FSIZE";
  /** File encoding. */
  String DBENCODING = "ENCODING";
  /** File chopping. */
  String DBCHOPPED = "CHOPPED";
  /** File chopping. */
  String DBENTITY = "ENTITY";
  /** File indexing. */
  String DBTXTINDEX = "TXTINDEX";
  /** File indexing. */
  String DBATVINDEX = "ATVINDEX";
  /** File word indexing. */
  String DBWRDINDEX = "WRDINDEX";
  /** File fulltext indexing. */
  String DBFTXINDEX = "FTXINDEX";
  /** Last (highest) id. */
  String DBLASTID = "LASTID";

  // XML SERIALIZATION ========================================================
  
  /** Text step. */
  byte[] TEXT = Token.token("text()");
  /** Text step. */
  byte[] COMM = Token.token("comment()");
  /** Text step. */
  byte[] PI = Token.token("processing-instruction()");
  /** Element output. */
  byte[] ELEM1 = Token.token("<");
  /** Element output. */
  byte[] ELEM2 = Token.token(">");
  /** Element output. */
  byte[] ELEM3 = Token.token("</");
  /** Element output. */
  byte[] ELEM4 = Token.token("/>");
  /** Text output. */
  byte[] TXT1 = Token.token("\"");
  /** Text output. */
  byte[] TXT2 = Token.token("\"");
  /** Attribute output. */
  byte[] ATT1 = Token.token("@");
  /** Attribute output. */
  byte[] ATT2 = Token.token("=\"");
  /** Attribute output. */
  byte[] ATT3 = Token.token("\"");
  /** Comment output. */
  byte[] COM1 = Token.token("<!--");
  /** Comment output. */
  byte[] COM2 = Token.token("-->");
  /** PI output. */
  byte[] PI1 = Token.token("<?");
  /** PI output. */
  byte[] PI2 = Token.token("?>");

  /** Opening result tag. */
  byte[] RESULT = Token.token("result");
  /** Opening result tag. */
  byte[] RESULTOPEN = Token.append(ELEM1, Token.append(RESULT, ELEM2));
  /** Closing result tag. */
  byte[] RESULTCLOSE = Token.append(ELEM3, Token.append(RESULT, ELEM2));
  /** Opening attribute tag. */
  byte[] RESULTATT1 = Token.append(ELEM1, Token.append(RESULT, Token.SPACE));
  /** Connecting attribute tag. */
  byte[] RESULTATT2 = ATT2;
  /** Closing attribute tag. */
  byte[] RESULTATT3 = Token.append(ATT3, ELEM4);

  /** Results tag. */
  byte[] RESULTS = Token.token("results");
  /** Opening results tag. */
  byte[] RESULTSOPEN = Token.append(ELEM1, Token.append(RESULTS, ELEM2));
  /** Closing results tag. */
  byte[] RESULTSCLOSE = Token.append(ELEM3, Token.append(RESULTS, ELEM2));
  /** Empty results tag. */
  byte[] RESULTSEMPTY = Token.append(ELEM1, Token.append(RESULTS, ELEM4));

  // RESULT INFORMATION =======================================================

  /** Query Hits. */
  String VALHIT = "Item";
  /** Query Hits. */
  String VALHITS = "Items";

  // TABLE SERIALIZATION ======================================================

  /** First table Header. */
  String TABLEHEAD1 = "PRE";
  /** Second table Header. */
  String TABLEHEAD2 = "DIS";
  /** Third table Header. */
  String TABLEHEAD3 = "SIZ";
  /** Fourth table Header. */
  String TABLEHEAD4 = "ATS";
  /** Fifth table Header. */
  String TABLEHEAD5 = "  KIND  CONTENT" + Prop.NL;
  /** Table Document. */
  String TABLEDOC = "  DOC ";
  /** Table Element. */
  String TABLEELEM = "  ELEM";
  /** Table Text. */
  String TABLETEXT = "  TEXT";
  /** Table Text. */
  String TABLEATTR = "  ATTR";
  /** Table Comment. */
  String TABLECOMM = "  COMM";
  /** Table Text. */
  String TABLEPI = "  PI  ";

  // PARSE STATES =============================================================
  
  /** Builder error. */
  String CREATECANCEL = "Building has been canceled.";
  /** Create Database information. */
  String CREATEINDEX = "Creating Indexes";
  /** Create Database information. */
  String CREATESIZE = "Finishing Table...";
  /** Finish process. */
  String CREATEFINISH = "Finishing...";

  /** Create Database information. */
  String CREATETXTINDEX = "Indexing Text...";
  /** Create Database information. */
  String CREATEATTINDEX = "Indexing Attributes...";
  /** Create Database information. */
  String CREATEWORDINDEX = "Indexing Words...";
  /** Create Database information. */
  String CREATEFTINDEX = "Indexing Fulltext...";

  // DATABASE FILES ===========================================================

  /** Database - Info. */
  String DATAINFO = "inf";
  /** Database - Tokens. */
  String DATATBL = "tbl";
  /** Database - Temporary Size References. */
  String DATATMP = "tmp";
  /** Database - Tag index. */
  String DATATAG = "tag";
  /** Database - Attribute name index. */
  String DATAATN = "atn";
  /** Database - Text index. */
  String DATATXT = "txt";
  /** Database - Attribute value index. */
  String DATAATV = "atv";
  /** Database - Word index. */
  String DATAWRD = "wrd";
  /** Database - Fulltext index. */
  String DATAFTX = "ftx";

  // DATA INFO ================================================================
  
  /** Data info. */
  String TAGINDEX = "NAME INDEX:";
  /** Data info. */
  String ATTINDEX = "ATTRIBUTE INDEX:";
  /** Data info. */
  String TEXTINDEX = "TEXT INDEX:";
  /** Data info. */
  String VALUEINDEX = "ATTRIBUTE INDEX:";
  /** Data info. */
  String WORDINDEX = "WORD INDEX:";
  /** Data info. */
  String FTINDEX = "FULLTEXT INDEX:";
}

